<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>timeout</title>
</head>
<body>
    <script>
        //语法：setTimeout(code,millisec);功能：在指定的毫秒数后调用函数或计算表达式
        //setTimeout("alert('hello')",4000);

        //自定义函数
        var fnCall=function(){
            alert("world");
        }

        //匿名函数
        var timeout1=setTimeout(function(){
            alert("hello");
        },2000)

        //取消超时调用
        clearTimeout(timeout1);

        //setTimeout(fnCall,5000);
    </script>


</body>
</html>